package ba.jamax.ralfdb.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import ba.jamax.ralfdb.domain.Book;
import ba.jamax.ralfdb.persistence.repository.specific.BookRepository;

@Controller
@RequestMapping("/book")
public class BookController extends AbstractController<Book> {

    private static final String SECTION_INDEX_VIEW = "ralfdb.book";

    public BookController() {
        super.setMainView(SECTION_INDEX_VIEW);
    }

    @Override
	public Class<Book> getPersistentClass() {
        return Book.class;
    }

    @Override
	public BookRepository getRepository() {
        return (BookRepository) super.getRepository();
    }

    @Autowired
    public void setBookRepository(final BookRepository repository) {
        super.setRepository(repository);
    }
}
